
// conponents/authorization/index.js
const app = getApp()
Component({
  
  data: {
     isShow:true
  },

  lifetimes:{
    attached(){
     
      const pageStack = getCurrentPages()
      
      const currentPage = pageStack.pop()

      const isShow = !!app.token
      this.setData({isShow})
      if(!isShow){
        wx.redirectTo({
          url: '/pages/login/login?returnUrl=/' + currentPage.route,
        })
      }
    }
  }
})
